/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author George
 */
@Entity
@Table(name = "CLIENTE_NATURAL", catalog = "BDACCELCOM", schema = "dbo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ClienteNatural.findAll", query = "SELECT c FROM ClienteNatural c"),
    @NamedQuery(name = "ClienteNatural.findByIdCliente", query = "SELECT c FROM ClienteNatural c WHERE c.idCliente = :idCliente"),
    @NamedQuery(name = "ClienteNatural.findByDni", query = "SELECT c FROM ClienteNatural c WHERE c.dni = :dni"),
    @NamedQuery(name = "ClienteNatural.findByNombres", query = "SELECT c FROM ClienteNatural c WHERE c.nombres = :nombres"),
    @NamedQuery(name = "ClienteNatural.findByApellidos", query = "SELECT c FROM ClienteNatural c WHERE c.apellidos = :apellidos")})
public class ClienteNatural implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "IdCliente")
    private Integer idCliente;
    @Basic(optional = false)
    @Column(name = "DNI")
    private String dni;
    @Column(name = "Nombres")
    private String nombres;
    @Column(name = "Apellidos")
    private String apellidos;
    @JoinColumn(name = "IdCliente", referencedColumnName = "IdCliente", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Cliente cliente;

    public ClienteNatural() {
    }

    public ClienteNatural(Integer idCliente) {
        this.idCliente = idCliente;
    }

    public ClienteNatural(Integer idCliente, String dni) {
        this.idCliente = idCliente;
        this.dni = dni;
    }

    public Integer getIdCliente() {
        return idCliente;
    }

    public void setIdCliente(Integer idCliente) {
        this.idCliente = idCliente;
    }

    public String getDni() {
        return dni;
    }

    public void setDni(String dni) {
        this.dni = dni;
    }

    public String getNombres() {
        return nombres;
    }

    public void setNombres(String nombres) {
        this.nombres = nombres;
    }

    public String getApellidos() {
        return apellidos;
    }

    public void setApellidos(String apellidos) {
        this.apellidos = apellidos;
    }

    public Cliente getCliente() {
        return cliente;
    }

    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCliente != null ? idCliente.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ClienteNatural)) {
            return false;
        }
        ClienteNatural other = (ClienteNatural) object;
        if ((this.idCliente == null && other.idCliente != null) || (this.idCliente != null && !this.idCliente.equals(other.idCliente))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.ClienteNatural[ idCliente=" + idCliente + " ]";
    }
    
}
